package com.xian.random;

import java.util.Random;
import java.util.Scanner;

public class RandomTest {
    public static void main(String[] args) {

        // 1-100幸运数字  （0-99）+ 1
        Random r = new Random();
        int luckNum = r.nextInt(100) + 1;

        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("请输入1-100数字：");
            int num = sc.nextInt();

            if (num > luckNum){
                System.out.println("太大啦！！！");
            }
            else if(num < luckNum){
                System.out.println("太小啦！！！");
            }else {
                System.out.println("恭喜！！！！");
                break;
            }
        }
    }
}
